package secondtest.po;

/**
 * 这个类用于映射一对一的结果：
 * 查询所有订单及其用户信息
 * 当没有pojo能够映射所有查询回来的字段时，当使用 ResultType 来映射结果时，
 * 通常自定义一个pojo类继承能够接收大部分数据的 Pojo ,并在这个类中添加剩余的属性
 *
 */
public class OrderWithUser extends Order {
    private String username;
    private int sex;
    private String address;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public String toString() {
        return "OrderWithUser{" +
                "username='" + username + '\'' +
                ", sex=" + sex +
                ", address='" + address + '\'' +
                "id=" + super.getId() +
                ", user_id=" + super.getUser_id() +
                ", number=" + super.getNumber() +
                ", createtime=" + super.getCreatetime() +
                ", note='" + super.getNote() + '\'' +
                '}';
    }
}
